package com.zds.zhouyi.ui;


import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.zds.zhouyi.R;
import com.zds.zhouyi.model.History;
import com.zds.zhouyi.util.ResUtil;
import com.zds.zhouyi.util.StringUtil;

import java.util.List;

public class QuickHistoryAdapter extends BaseQuickAdapter<History, BaseViewHolder> {

    public QuickHistoryAdapter(List<History> data) {
        super(R.layout.history_item, data);
    }

    public QuickHistoryAdapter() {
        super(R.layout.history_item);
    }


    @Override
    protected void convert(BaseViewHolder baseViewHolder, History history) {

        baseViewHolder.setText(R.id.tv_time, ResUtil.getString(R.string.history_time, StringUtil.getDateByTimestamp(history.getTime())));
        baseViewHolder.setText(R.id.tv_gua, ResUtil.getString(R.string.history_gua, history.getGua().getName()));
        baseViewHolder.setText(R.id.tv_gua_info, history.getGua().toStringNoName());
        baseViewHolder.setGone(R.id.tv_gua_info, !history.isShow());
    }

}